home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE6 / PD / PDF / GuiLib / Task / h / GuiTask < prev    next >
Text File  |  2003-02-14  |  3KB  |  81 lines

  1. //--------------------------------------------------------------------------
  2. //
  3. //   Copyright (c) 2002, Colin Granville
  4. //
  5. //   All rights reserved.
  6. //
  7. //   Redistribution and use in source and binary forms, with or
  8. //   without modification, are permitted provided that the following 
  9. //   conditions are met:
  10. //
  11. //      * Redistributions of source code must retain the above copyright 
  12. //        notice, this list of conditions and the following disclaimer.
  13. //
  14. //      * Redistributions in binary form must reproduce the above 
  15. //        copyright notice, this list of conditions and the following 
  16. //        disclaimer in the documentation and/or other materials 
  17. //        provided with the distribution.
  18. //
  19. //      * The name Colin Granville may not be used to endorse or promote 
  20. //        products derived from this software without specific prior 
  21. //        written permission.
  22. //
  23. //   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
  24. //   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  25. //   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
  26. //   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
  27. //   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
  28. //   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  29. //   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
  30. //   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
  31. //   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
  32. //   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  33. //   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
  34. //   OF THE POSSIBILITY OF SUCH DAMAGE.
  35. //
  36. //--------------------------------------------------------------------------
  37.  
  38. #ifndef GuiTask_H
  39. #define GuiTask_H
  40.  
  41. #include "stl:string.h"
  42. #include "GuiSprite.h"
  43. #include "GuiToolbox.h"
  44.  
  45. #define GUI_TASK_ALL_MESSAGES ((int*)1)
  46.  
  47. // allow all messages by default
  48. void guiTaskInitialise(const char* resource_directory,int wimp_version=310,
  49.                        int *wimp_mess=GUI_TASK_ALL_MESSAGES,
  50.                        int *tbox_events=GUI_TASK_ALL_MESSAGES);
  51.  
  52. class GuiTask;
  53. GuiTask& guiTask();
  54.  
  55. class GuiObject;
  56.  
  57. class GuiTask
  58. {
  59.   public:
  60.     friend GuiTask& guiTask();
  61.  
  62.     const GuiSpriteArea*     spriteArea() const              {return m_sprite_area;}
  63.     static void              raiseEvent(GuiObject&,
  64.                                          GuiToolboxEvent& event,
  65.                                          GuiComponentId=NULL_GuiComponentId);
  66.     const char*              lookup(const char* token,const char* p0=0,const char* p1=0,
  67.                                                       const char* p2=0,const char* p3=0);
  68.     const GuiIdBlock&        idBlock() const                 {return m_id_block;}
  69.   private:
  70.     GuiTask();
  71.     int                      m_wimp_version;
  72.     string                   m_resource_directory;
  73.     string                   m_name;
  74.     int                      m_handle;
  75.     GuiSpriteArea*           m_sprite_area;
  76.     GuiMessagesFD            m_messages;
  77.     GuiIdBlock               m_id_block;
  78. }; 
  79.  
  80. #endif
  81.